<!--title-->
<div class="mnav1">
	<div class="m_nav">
		<div class="nav_left">
			<em class="home_icon"><?=$this->sys_name?></em><span>&nbsp;&gt;&nbsp;</span><font><?=$this->title?></font>
		</div>
	</div>
</div>

<div class="content-table2">
<div class="content-table-title"><?=$this->title?></div>
<div class="form-edit-task">

<form action="/clients/add-signer-submit" method="post" name="form1" enctype="multipart/form-data" onsubmit="submitform(this);return false;">
<table border="0" width="100%">
	<tr>
		<td align="right">签约公司全称：</td>
		<td align="left">&nbsp;<input type="text" placeholder="签约公司全称" name="company_name" id="company_name" value="<?=$_SESSION['tmp_client_info']['client_name']?$_SESSION['tmp_client_info']['client_name']:""?>" style="width: 300px"><font color="red"> * 与营业执照必须完全一致</font></td>
	</tr>
	<tr>
		<td align="right">省份：</td>
		<td align="left">&nbsp;<select name="province_id" id="province_id" onchange="GetCities(this.options[this.options.selectedIndex].value);">
					<option value="">不限</option>
					<?php if(!empty($this->provinces)):?>
					<?php foreach($this->provinces as $provinceId => $provinceName):?>
					<option value="<?=$provinceId?>"><?=$provinceName?></option>
					<?php endforeach;?>
					<?php endif;?>
				</select><font color="red"> *</font>
		</td>
	</tr>
	<tr>
		<td align="right">城市：</td>
		<td align="left">&nbsp;<select name="city_id" id="city_id"></select><font color="red"><font color="red"> *</font></td>
	</tr>
	<tr>
		<td align="right">注册地址：</td>
		<td align="left">&nbsp;<input type="text" placeholder="注册地址" name="register_address" id="register_address" style="width: 300px"></td>
	</tr>
	<tr>
		<td align="right">联系人：</td>
		<td align="left">&nbsp;<input type="text" placeholder="联系人" name="contact_name" id="contact_name" value="<?=$_SESSION['tmp_client_info']['contact_name']?$_SESSION['tmp_client_info']['contact_name']:""?>"></td>
	</tr>
	<tr>
		<td align="right">联系/收件地址：</td>
		<td align="left">&nbsp;<input type="text" placeholder="联系/收件地址" name="contact_address" id="contact_address" value="<?=$_SESSION['tmp_client_info']['address']?$_SESSION['tmp_client_info']['address']:""?>" style="width: 300px"></td>
	</tr>
	<tr>
		<td align="right">邮编：</td>
		<td align="left">&nbsp;<input type="text" placeholder="邮编" name="zipcode" id="zipcode" value="<?=$_SESSION['tmp_client_info']['zipcode']?$_SESSION['tmp_client_info']['zipcode']:""?>"></td>
	</tr>
	<tr>
		<td align="right">联系电话：</td>
		<td align="left">&nbsp;<input type="text" placeholder="联系电话" name="tel" id="tel" value="<?=$_SESSION['tmp_client_info']['tel']?$_SESSION['tmp_client_info']['tel']:""?>"></td>
	</tr>
	<tr>
		<td align="right">传真：</td>
		<td align="left">&nbsp;<input type="text" placeholder="传真" name="fax" id="fax" value="<?=$_SESSION['tmp_client_info']['fax']?$_SESSION['tmp_client_info']['fax']:""?>"></td>
	</tr>
	<tr>
		<td align="right">法定代表人：</td>
		<td align="left">&nbsp;<input type="text" placeholder="法定代表人" name="company_owner" id="company_owner"></td>
	</tr>
	<tr>
		<td align="right">营业执照注册号：</td>
		<td align="left">&nbsp;<input type="text" placeholder="营业执照注册号" name="business_number" id="business_number"></td>
	</tr>
	<tr>
		<td align="right">纳税人识别号：</td>
		<td align="left">&nbsp;<input type="text" placeholder="纳税人识别号" name="tax_number" id="tax_number"></td>
	</tr>
	<tr>
		<td align="right">开户银行：</td>
		<td align="left">&nbsp;<input type="text" placeholder="开户银行" name="bank_name" id="bank_name" style="width: 300px"></td>
	</tr>
	<tr>
		<td align="right">开户行账号：</td>
		<td align="left">&nbsp;<input type="text" placeholder="开户行账号" name="bank_number" id="bank_number" style="width: 300px"></td>
	</tr>
	<tr>
		<td align="right">年检到期日：</td>
		<td align="left">&nbsp;<input type="text" placeholder="年检到期日" name="business_expired_date" id="business_expired_date" autocomplete="off"></td>
	</tr>
	<tr>
		<td align="right">一般纳税人：</td>
		<td align="left">&nbsp;<input type="radio" name="is_regular_taxpayer" id="is_regular_taxpayer_1" value="1"><label for="is_regular_taxpayer_1">&nbsp;是</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="is_regular_taxpayer" id="is_regular_taxpayer_0" value="0"><label for="is_regular_taxpayer_0">&nbsp;不是</label></td>
	</tr>
	<tr>
		<td align="right">营业执照：</td>
		<td align="left">&nbsp;<input type="file" name="img1" id="img1" /></td>
	</tr>
	<tr>
		<td align="right">税务登记：</td>
		<td align="left">&nbsp;<input type="file" name="img2" /></td>
	</tr>
	<tr>
		<td align="right">开户银行：</td>
		<td align="left">&nbsp;<input type="file" name="img3" /></td>
	</tr>
	<tr>
		<td align="right">纳税人证明：</td>
		<td align="left">&nbsp;<input type="file" name="img4" /></td>
	</tr>
	<tr>
		<td colspan="2" align="center"><br><br><input type="button" class="buttonlong" value="提交审核" onclick="submitform();return false;" /></td>
	</tr>
</table>
<br /><br />
</form>
</div>
<br/><br/>
</div>

<script>
<?php if($this->msg):?>
alert("<?=$this->msg?>, 信息提交失败, 请修改后再次提交。");
<?php endif;?>

$(function() {
	$( "#business_expired_date" ).datepicker({ dateFormat: 'yy-mm-dd', changeMonth: true, changeYear: true});
});

function GetCities(provinceId)
{
	$.ajax({
			type: "post",
			url : "/ajax/get-cities",
			dataType:'json',
            async:false,
			data: {
					'provinceId':provinceId
				  },
				success: function(json){
					if(json.result == 1 && typeof(json.data) != "undefined") {
                        var arr = json.data;
						var txt = "<option value=''>不限</option>";
						
                        for(i=0; i < arr.length; i++){
							txt += "<option value='" + arr[i]['cityId'] + "'>" + arr[i]['cityName'] + "</option>";
                        }
						
						document.getElementById("city_id").innerHTML = txt;
                    }
			}
		});
}

function submitform() 
{
	
	if( document.form1.company_name.value.length == 0 )
	{
		alert("签约公司全称不能为空。");
		return false;
	}else if( document.form1.province_id.value.length == 0 )
	{
		alert("省份不能为空。");
		return false;
	}else if( document.form1.city_id.value.length == 0 )
	{
		alert("城市不能为空。");
		return false;
	}
	
	form1.submit();
}
</script>
